package test;

import object.Teacher;
import object.Course;
import object.Student;

public class Test {
    public static void main(String[] args) {
        // 创建教师
        Teacher teacher1 = new Teacher("T001", "张梦", "男");
        Teacher teacher2 = new Teacher("T002", "李元", "女");

        // 创建课程并关联教师
        Course course1 = new Course("C001", "Java编程", "A101", "周一 8:00-10:00");
        Course course2 = new Course("C002", "数据结构", "B202", "周二 14:00-16:00");
        teacher1.setCourse(course1);
        teacher2.setCourse(course2);
        course1.setTeacher(teacher1);
        course2.setTeacher(teacher2);

        // 打印教师信息
        System.out.println("=== 教师信息 ===");
        System.out.println(teacher1);
        System.out.println(teacher2);
        System.out.println("\n=== 教师课表 ===");
        teacher1.printWorkSheet();
        teacher2.printWorkSheet();

        // 创建学生并选课
        Student student1 = new Student("S001", "小明", "男");
        Student student2 = new Student("S002", "小红", "女");

        System.out.println("\n=== 学生初始信息 ===");
        System.out.println(student1);
        System.out.println(student2);

        student1.selectCourse(course1);
        student2.selectCourse(course2);

        // 打印学生选课信息及课表
        System.out.println("\n=== 学生选课信息 ===");
        System.out.println(student1);
        System.out.println(student2);
        System.out.println("\n=== 学生课表 ===");
        student1.printWorkSheet();
        student2.printWorkSheet();

        // 学生退课
        student1.dropCourse();
        System.out.println("\n=== 学生退课表 ===");
        student1.printWorkSheet();
    }
}